﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMove : MonoBehaviour
{
    public CharacterController2D cc;
    public float speed = 5f;

    float move;
    bool jump;
    void Start()
    {
        cc = GetComponent<CharacterController2D>();
    }
    
    void Update()
    {
        move = Input.GetAxis("Horizontal");
        move *= speed;
        jump = Input.GetButton("Jump");
    }

    void FixedUpdate()
    {
        cc.Move(move, jump);
    }
}
